package cn.iocoder.yudao.module.form.service.impl;

import cn.iocoder.yudao.module.form.dataobject.FormEquipment;
import cn.iocoder.yudao.module.form.mysql.FormEquipmentMapper;
import cn.iocoder.yudao.module.form.service.IFormEquipmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 设备采购Service业务层处理
 *
 * @author ruoyi
 * @date 2022-07-13
 */
@Service
public class FormEquipmentServiceImpl implements IFormEquipmentService
{
    @Autowired
    private FormEquipmentMapper formEquipmentMapper;

    /**
     * 查询设备采购
     *
     * @param equId 设备采购主键
     * @return 设备采购
     */
    @Override
    public FormEquipment selectFormEquipmentByEquId(Long equId)
    {
        return formEquipmentMapper.selectFormEquipmentByEquId(equId);
    }

    /**
     * 查询设备采购列表
     *
     * @param formEquipment 设备采购
     * @return 设备采购
     */
    @Override
    public List<FormEquipment> selectFormEquipmentList(FormEquipment formEquipment)
    {
        return formEquipmentMapper.selectFormEquipmentList(formEquipment);
    }

    /**
     * 新增设备采购
     *
     * @param formEquipment 设备采购
     * @return 结果
     */
    @Override
    public int insertFormEquipment(FormEquipment formEquipment)
    {
//        formEquipment.setCreateTime(DateUtils.getNowDate());
        return formEquipmentMapper.insertFormEquipment(formEquipment);
    }

    /**
     * 修改设备采购
     *
     * @param formEquipment 设备采购
     * @return 结果
     */
    @Override
    public int updateFormEquipment(FormEquipment formEquipment)
    {
//        formEquipment.setUpdateTime(DateUtils.getNowDate());
        return formEquipmentMapper.updateFormEquipment(formEquipment);
    }

    /**
     * 批量删除设备采购
     *
     * @param equIds 需要删除的设备采购主键
     * @return 结果
     */
    @Override
    public int deleteFormEquipmentByEquIds(Long[] equIds)
    {
        return formEquipmentMapper.deleteFormEquipmentByEquIds(equIds);
    }

    /**
     * 删除设备采购信息
     *
     * @param equId 设备采购主键
     * @return 结果
     */
    @Override
    public int deleteFormEquipmentByEquId(Long equId)
    {
        return formEquipmentMapper.deleteFormEquipmentByEquId(equId);
    }
}
